import java.util.Scanner;

import static java.lang.Math.PI;

public class Circle {
    //计算圆的面积和周长
    double r;
    public void getArea(){
       double area=PI*r*r;
        System.out.println("圆的半径："+r+"\n"+"圆的面积："+area);
    }
    public void getPerimeter(){
        double perimeter = 2*PI*r;
        System.out.println("圆的周长="+perimeter);
    }

    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        Circle c=new Circle();
        System.out.print("请输入圆的半径：");
        double r1=in.nextDouble();
        c.r=r1;
        c.getArea();
        c.getPerimeter();
    }
}
